package com.example.siteservices.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.siteservices.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper extends BaseMapper<User> {
    
    /**
     * 根据用户名查找用户
     *
     * @param username 用户名，用于查询的唯一标识
     * @return 返回匹配用户名的用户对象，如果不存在则返回null
     */
    @Select("SELECT * FROM users WHERE username = #{username}")
    User findByUsername(String username);
} 